<%@ page import="java.sql.DriverManager" %>
<%@ page import="java.sql.PreparedStatement" %>
<%@ page import="java.sql.ResultSet" %>
<%@ page import="java.sql.Connection" %>
<%@ page import="Dao.UserDao" %><%--
  Created by IntelliJ IDEA.
  User: Muerzhi
  Date: 2023/12/24
  Time: 19:02
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<%
  String  account=request.getParameter("account");
  String  password=request.getParameter("password");
%>

<%

  UserDao userDao = new UserDao();
  int check = userDao.checkId(account,password);
  if(check!=0) {
      response.sendRedirect("index.jsp");
  }else{
    out.println("<script>");
    out.println("alert('账号密码错误，请重新登录');");
    out.println("location.href='login.jsp'");
    out.println("</script>");
  }


%>

<%

%>
</body>
</html>
